package top.zhangjianyong.tools.wechat;

import com.alibaba.dashscope.common.Message;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author zhangjianyong
 * @since 2025/3/19 下午5:30
 */
@Data

public class WechatContent {
    private String openId; //用户标识
    private List<Message> messages; //当前节点key
    private LocalDateTime lastTime;

    public WechatContent(String openId, List<Message> messages) {
        this.openId = openId;
        this.messages = messages;
        this.lastTime = LocalDateTime.now();
    }

    public boolean isExpire() {
        return lastTime.plusHours(24).isBefore(LocalDateTime.now());
    }
}
